package com.saga.dim.util;

public enum WeekEnum {

    Mon(new String[]{"Monday", "星期一"}, 1),
    Tue(new String[]{"Tuesday", "星期二"}, 2),
    Wed(new String[]{"Wednesday", "星期三"}, 3),
    Thur(new String[]{"Thursday", "星期四"}, 4),
    Fri(new String[]{"Friday", "星期五"}, 5),
    Sat(new String[]{"Saturday", "星期六"}, 6),
    Sun(new String[]{"Sunday", "星期日"}, 7);

    private Integer index;
    private String[] values;

    private WeekEnum(String[] values, Integer index){
        this.index = index;
        this.values = values;
    }

    public static String getName(Integer index, Integer i) {
        for (WeekEnum c : WeekEnum.values()) {
            if (c.getIndex() == index) {
                return c.getValue(i);
            }
        }
        return null;
    }

    public String getValue(Integer i){
        return values[i];
    }

    public String[] getValues() {
        return values;
    }

    public void setValues(String[] values) {
        this.values = values;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public Integer getIndex() {
        return index;
    }
}
